package test.format_test;

/**
 * @author ：xxx
 * @description：TODO
 * @date ：2022/4/5 12:35
 */
public class finalize {
   public static void main(String agrs[]){
       tfinal a = new tfinal();
       a = null;
       System.gc();
       System.out.println("结束");
   }
}

class tfinal{
    String name = "测试";

    protected void finalize() throws Throwable {
        System.out.println("被回收--"+name);
    }
}